package xinyou.jh.net.scene
{
	import xinyou.jh.net.JHStruct;
	
	public class SceneStruct extends JHStruct
	{
		public function SceneStruct()
		{
			super();
		}
		override protected function initReceiverHash():void
		{
			addReceiverHash([151,3],CW_CONNECTION_ENTERSERVER_ACK);//收到用户信息
			addReceiverHash([151,6],MSG_CW_CONNECTION_ENTERSCENE_ACK);//客户端发送命令和结构体
			addReceiverHash([103,4],CG_SYNC_ALLPLAYERS_CMD);//视野范围内玩家加载
			addReceiverHash([103,5],CG_SYNC_ALLMONSTERS_CMD);//视野范围内怪物加载
			addReceiverHash([103,1],CG_SYNC_PLAYER_ENTER_ACK);//自己进入房间消息
			addReceiverHash([103,2],CG_SYNC_PLAYER_ENTER_NAK);//自己进入房间消息
			addReceiverHash([103,33],CG_SYNC_MOVE_BRD);//其他玩家移动消息
			addReceiverHash([103,7],CG_SYNC_PLAYER_LEAVE_BRD);//玩家离开视野广播
			addReceiverHash([103,8],CG_SYNC_MONSTER_LEAVE_BRD);//怪物离开视野广播
			addReceiverHash([103,28],CG_SYNC_MONSTER_MOVE_BRD);//怪物闲逛
			addReceiverHash([101,7],PLAYERINFO_FOR_PACKET);//用户详细信息
			addReceiverHash([114,10],PACKET_CG_FWD_OPEN);//属性更新消息
			addReceiverHash([151,12],CW_CONNECTION_CREATECHAR_ACK);//创建角色
			addReceiverHash([151,14],CW_CONNECTION_DESTORYCHAR_ACK);//删除角色
		}
		
		override protected function initSenderHash():void
		{
			addSenderHash([151,1],CW_CONNECTION_ENTERSERVER_SYN);//客户端发送命令和结构体
			addSenderHash([103,32],CG_SYNC_KBMOVE_SYN);//场景移动开始消息请求
			addSenderHash([103,35],CG_SYNC_STOP_SYN);//场景移动结束消息请求
			addSenderHash([103,0],CG_SYNC_PLAYER_ENTER_SYN);//进入房间消息
			addSenderHash([151,11],CW_CONNECTION_CREATECHAR_SYN);//创建角色
		}
		public var CG_SYNC_MONSTER_MOVE_BRD:XML =
			<struct>
				DWORD				m_dwObjectKey;
				BYTE						m_byState;
				UINT16					wvCurPosX;
				UINT16					wvCurPosY;
				UINT16					wvDestPosX;
				UINT16					wvDestPosY;
			</struct>;
		public var CG_SYNC_ALLMONSTERS_CMD:XML =
			<struct>
				LIST MONSTER_RENDER_INFO monsters[BYTE];
			</struct>;
		public var MONSTER_RENDER_INFO:XML =
			<struct>
				DWORD				m_dwType;//Object对象类型（怪，守卫等等）
				DWORD				m_dwObjectKey;
				DWORD				m_dwMonsterCode;
				DWORD				m_dwDBID;
				BYTE				m_byPhase;
				BYTE				m_byType;
				UINT16					m_nPosx;
				UINT16					m_nPosy;
				UINT16					m_nDestX;
				UINT16					m_nDestY;
				BYTE					m_nDir;
				DWORD				m_dwMaxHP;
				DWORD				m_dwHP;
				DWORD				m_dwMaxMP;
				DWORD				m_dwMP;
				WORD					m_wMoveSpeedRatio;
				WORD					m_wAttSpeedRatio;
				WORD					m_Lv;
				DWORD				m_dwOwnerObjKey;
				DWORD				m_dwAvaCode;
				CHAR					m_pszName[40];
				BYTE						m_nCamp;
				BYTE						m_byCount;
			</struct>;
		public var CG_SYNC_MONSTER_LEAVE_BRD:XML =
			<struct>
				Array DWORD monsters[BYTE];
			</struct>;
		public var CG_SYNC_PLAYER_ENTER_NAK:XML =
			<struct>
				DWORD		m_dwErrorCode;
			</struct>;
		public var CW_CONNECTION_DESTORYCHAR_ACK:XML =
			<struct>
				UINT16		m_nErrorCode;
			</struct>;
		
		public var CW_CONNECTION_CREATECHAR_ACK:XML =
			<struct>
				UINT16		m_nErrorCode;
				STRUCT		CLIENT_CHARACTER_PART;
			</struct>;
		
		public var CW_CONNECTION_CREATECHAR_SYN:XML =
			<struct>
				CHAR						m_szCharName[16];
				BYTE						m_byGender;//性别
				BYTE						m_byHeight;//没用
				BYTE						m_byFace;//头像
				BYTE						m_byHair;//发型
			</struct>;
		
		public var PACKET_CG_FWD_OPEN:XML =
			<struct>
				GUID	m_dwObjKey;//角色
				BYTE	m_AttrType;//属性类型
				DWORD	m_dwValue;//属性值
			</struct>;
		
		public var CW_CONNECTION_ENTERSERVER_SYN:XML =
			<struct>
				DWORD						m_dwAuthID;//验证KEY,相当于CL的CID,但在WorldServer中这个则是帐号ID
				char						m_szID[20];//帐号名称
				BYTE						m_byHighVerNo;//版本
				BYTE						m_byMiddleVerNo;
				BYTE						m_byLowVerNo;
				char						m_szSerialKey[32];//加密KEY
			</struct>;
		
		public var CW_CONNECTION_ENTERSERVER_ACK:XML =
			<struct>
				UINT16					m_nErrorCode;
				DWORD					m_nLoginTime;//登陆服务器时间
				LIST CLIENT_CHARACTER_PART m_ccCharacterPart[BYTE];
			</struct>;
		
		public var CLIENT_CHARACTER_PART:XML =
			<struct>
				CHAR			m_tszCharName[16];
				BYTE          m_byGender;//性别添加
				BYTE			m_byFace;
				BYTE			m_byHeight;
				BYTE			m_byHair;
				UINT16			m_LV;//人物等级
				UINT			m_dwRegion;
				UINT16			m_wX;
				UINT16			m_wY;
				STRUCT 		EQUIP_ITEM_INFO;//导入另一个结构体
			</struct>;
		
		/**
		 * 进入房间结果
		 */		
		public var CG_SYNC_PLAYER_ENTER_ACK:XML = 
			<struct>
				GUID						m_dwObjectKey;
				UINT16						m_nPosX;
				UINT16						m_nPosY;
				SHORT						m_nDir;
				BYTE						m_byInBattle;//是否在副本
				DWORD						m_dwBattleLeftTime;//在副本的剩余时间
			</struct>;
		
		public var EQUIP_ITEM_INFO:XML =
			<struct>
				LIST ITEMSLOTEX m_Slot[BYTE];
			</struct>;
		
		public var ITEMSLOTEX:XML =
			<struct>
				WORD m_ItemPos;
				STRUCT ITEMSTREAMEX;
			</struct>;
		
		public var ITEMSTREAMEX:XML =
			<struct>
				STRUCT		ITEMPART;
				STRUCT		OPTIONPART;
			</struct>;
		
		public var ITEMPART:XML =
			<struct>
				DWORD		dwSerial;//序列号
				DWORD		dwCode;//物品id
				DWORD		dwDura;//durability武器就是耐久，消耗品就是数量
			</struct>;
		
		public var OPTIONPART:XML =
			<struct>
				BYTEARRAY	bindInfo[2];
				BYTE		SocketOption1;
				BYTE		SocketOption2;
				BYTE		SocketOption3;
				LIST ADDITATION_ATTR	AdditationAttrib[5];
			</struct>;
		
		public var ADDITATION_ATTR:XML =
			<struct>
				BYTE	bybIndex;
				SHORT	nValue;
			</struct>;
		
		public var MSG_CW_CONNECTION_ENTERSCENE_ACK:XML =
			<struct>
				UINT16						m_nErrorCode;
				GUID						m_dwPlayerKey;
				UINT16						m_nGameServerID;
				DWORD						m_nGoingMapID;//要去的地图
			</struct>;
		
		/**
		 * 开始移动请求结构体 
		 */		
		public var CG_SYNC_KBMOVE_SYN:XML = 
			<struct>
				UINT16						m_posx;
				UINT16						m_posy;
			</struct>;
		
		/**
		 * 结束移动请求结构体 
		 */		
		public var CG_SYNC_STOP_SYN:XML = 
			<struct>
				UINT16						m_posx;
				UINT16						m_posy;
			</struct>;
		
		/**
		 * 移动广播
		 */		
		public var CG_SYNC_MOVE_BRD:XML = 
			<struct>
				GUID						m_dwObjectKey;
				UINT16						m_posx;
				UINT16						m_posy;
			</struct>;
		
		/**
		 * 其他玩家集合
		 */		
		public var CG_SYNC_ALLPLAYERS_CMD:XML = 
			<struct>
				LIST PLAYER_RENDER_INF	playerInfo[BYTE];
			</struct>;
		
		/**
		 * 其他玩家信息
		 */		
		public var PLAYER_RENDER_INF:XML = 
			<struct>
				GUID					m_dwObjectKey;
				UINT					m_HP;
				UINT					m_MaxHP;
				UINT					m_MP;
				UINT					m_MaxMP;
				UINT16					m_LV;
				CHAR					m_lpszName[16];
				UINT16					m_nPosx;
				UINT16					m_nPosy;
				UINT					m_SelectStyleCode;
				WORD					m_wMoveSpeedRatio;//移动速度
				WORD					m_wAttSpeedRatio;//攻击速度
				BYTE					m_byHair;//头发				
				BYTE					m_byHeight;//身高
				BYTE					m_byFace;//脸
				BYTE					m_byHelmetOption;//头盔选项(0:显示,1:不显示)			
				BYTE					m_byGMGrade;//GM等级(0:老馆,1捞惑:GM)
				BYTE					m_byPCBangUser;//PC规蜡历(0:老馆,1:PC规)
				BYTE					m_byCondition;
				BYTE					m_byGender;//性别
				BYTE					m_byPKMode;//PK模式	
				BYTE					m_BehaveState;
				BYTE					m_byCamp;//阵营
				DWORD					m_dwPkValue;
				DWORD					m_dwAvaCode;//玩家变身模型
				BYTE					m_byHaveTeam;
				CHAR					szTeamName[32];//队伍名称
				DWORD					m_dwMountID;
				BYTE					m_byMountGrede;
				SHORT					m_sVipLv;
				DWORD					m_dwCurNameID;
				UINT16             	m_sDir;//当前朝向
				LIST	STATE_INFO		stateInfo[BYTE];//状态集合
				LIST	GUILD_RENDER_INFO		guildInfo[BYTE];//工会信息集合
				LIST	EQUIP_ITEM_BASEINFO		equipItemInfo[BYTE];//装备基础信息集合
			</struct>;
		
		/**
		 * 玩家状态结构体
		 */		
		public var STATE_INFO:XML = 
			<struct>
				WORD						m_wStatusCode;
				int							m_iTicks;
			</struct>;
		/**
		 * 工会信息结构体
		 */		
		public var GUILD_RENDER_INFO:XML = 
			<struct>
				INT							m_GuildMarkIdx;
				INT							m_GuildGuid;
				BYTE						m_byGuildPos;
				CHAR						m_tszGuildName[16];
			</struct>;
		/**
		 * 装备基础信息结构体
		 */		
		public var EQUIP_ITEM_BASEINFO:XML = 
			<struct>
				WORD	m_itemPos;
				WORD	m_byEnchant;//m_byEnchant等级 
				DWORD	m_dwItemCode;
			</struct>;
		
		
		/**
		 * 进入房间请求结构体
		 */		
		public var CG_SYNC_PLAYER_ENTER_SYN:XML = 
			<struct>
				DWORD	m_dwCheckSum;
			</struct>;
		
		
		/**
		 * 进入房间结果
		 */		
		public var CG_SYNC_PLAYER_LEAVE_BRD:XML = 
			<struct>
				Array GUID players[BYTE];//离开视野的玩家数量
			</struct>;
		
		/**
		 * 用户详细信息
		 */		
		public var PLAYERINFO_FOR_PACKET:XML = 
			<struct>
				INT		m_UserGuid;
				INT		m_CharGuid;
				BYTE		m_byGender;
				CHAR		m_tszCharName[16];
				SHORT		m_nLevel;
				ULONG		m_uExp;
				DWORD		m_dwRemainStat;
				DWORD		m_dwRemainSkill;
				LONG		m_Money;
				DWORD		m_SelectStyleCode;
				INT			m_MaxHP;
				INT			m_HP;
				INT			m_MaxMP;
				INT			m_MP;
				WORD		m_wDander;//怒气值
				WORD		m_wMoveSpeedRatio;//移动速度
				WORD		m_wAttSpeedRatio;//攻击速度
				LONG		m_StateTime;
				CHAR		m_tszTitleID[16];
				LONG		m_TitleTime;
				INT			m_sStrength;
				INT			m_sDexterity;
				INT			m_sVitality;
				WORD		m_wSkillStat1;
				WORD		m_wSkillStat2;				
				INT			m_nPhyDamage;//物理伤害值
				INT			m_nPhyDefence;//物理防御值
				INT			m_nAttackRate;//攻击命中
				INT			m_nAttackDodge;//攻击躲闪
				INT			m_nAtkCritical;//攻击暴击
				INT			m_nParry;//招架
				INT			m_nDefStun;//一定机率防御击晕效果
				INT			m_nDefMute;//一定机率防御沉默效果
				INT			m_nDefArmor;//一定机率防御破甲效果
				INT			m_nDefSlow;//一定机率防御减速效果
				INT			m_nDefWreathe;//一定机率防御缠绕效果				
				BYTE		m_byGMGrade;
				BYTE		m_byPCBangUser;
				BYTE		m_byCondition;
				BYTE		m_byPKState;
				BYTE		m_byCharState;
				INT			m_PlayLimitedTime;
				BYTE		m_bInventoryLock;
				BYTE		m_byInvisibleOptFlag;
				INT			m_GuildGuid;
				BYTE		m_byGuildPos;
				CHAR		m_tszGuildName[16];
				DWORD		m_dwPk;
				BYTE		m_byVendorLv;
				LONG 		m_Coupons;
				LONG		m_YuanBao;	//元宝
				WORD		m_wSunLv;
				WORD		m_wMoonLv;
				CHAR		m_tszBootRecord[128];//新手引导记录
				SHORT		m_sVipLv;
				DWORD		m_dwVipExp;
				BYTE		m_nCamp;//阵营
				DWORD		m_dwCurNameID;//当前称号ID	
				DWORD		m_dwAccompPoint;//成就点	
				DWORD		m_dwPractice;//修为值	
				INT			m_nFame;//--名声--
				BYTE		m_nLuck;//--福缘--
				INT			m_nTired;//疲劳值
				BYTE		m_byInventoryTotalNum;//格子总数
				BYTE		m_InvenCount;
				BYTE		m_MissionItemInvenCount;
				LIST 	ITEMSLOTEX m_ItemInfo[$m_InvenCount];
				LIST 	ITEMSLOTEX m_TaskItemInfo[$m_MissionItemInvenCount];
			</struct>;
	}
}